package com.tencent.ncnnyolox.basemodule.utils

import android.content.Context
import android.util.Log

/**
 * <pre>
 *     author : yh
 *     e-mail : xxx@xx
 *     time   : 2022/01/17
 *     desc   :
 * </pre>
 */
object CommonLog {
    /**
     * todo 是否显示log日志，发版改成false
     */
    private var sShowLog = true


    fun v(context: Context?, tag: String?, msg: String) {
        Log.v(tag, msg)
    }

    fun d(tag: String?, msg: String) {
        if (sShowLog) {
            Log.d(tag, msg)
        }
    }



        fun d(context: Context?, tag: String?, msg: String) {
        Log.d(tag, msg)
    }

    fun i(tag: String?, msg: String) {
        if (sShowLog) {
            Log.i(tag, msg)
        }
    }

    fun i(context: Context?, tag: String?, msg: String) {
        Log.i(tag, msg)
    }

    fun e(tag: String?, msg: String) {
        if (sShowLog) {
            Log.e(tag, msg)
        }
    }

    fun e(context: Context?, tag: String?, msg: String) {
        Log.e(tag, msg)
    }

    fun e(tag: String?, msg: String?, tr: Throwable?) {
        Log.e(tag, msg, tr)
    }

    fun e(context: Context?, tag: String?, msg: String?, tr: Throwable?) {
        Log.e(tag, msg, tr)
    }

    fun setLOG(context: Context?, lOG: Boolean) {
        sShowLog = lOG
    }
}